package com.juyu.miliao.api.dao.mysql;

import java.util.HashMap;
import java.util.Map;

import org.apache.ibatis.session.SqlSession;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Repository;

import com.juyu.miliao.api.domain.Blacklist;

@Repository
public class BlacklistDao {
	@Autowired
	private SqlSession sqlSession;

	public void addBlacklist(Blacklist entity) {
		sqlSession.insert("addBlacklist", entity);
	}

	public void removeBlacklist(Blacklist entity) {
		sqlSession.delete("removeBlacklist", entity);
	}
	
	
	public int findCountBlacklist(long userId ,long blacklistUserId){
		Map<String, Object> params = new HashMap<>();
		params.put("userId", userId);
		params.put("blacklistUserId", blacklistUserId);
		return sqlSession.selectOne("findCountBlacklist", params);
	}


}
